﻿/*
{
"状态":1,
"名称":"新增-角色权限资料",
"作者":"陈泽椿",
"创建时间":"2018-06-30",
"功能":"新增-角色权限资料",
"log": [
	{"date":"06-01" , "dev" :"hzhh" , "content" : ""}
]
}
*/

 
declare @role_key int 
declare @power varchar(4000)

set @role_key='{role_key}'
set @power='{power}'

insert into  y_role_power (power_key,role_key,create_time,update_time)
select A.power_key,A.role_key,getdate(),getdate() from 
(
select convert(int,value) as power_key,@role_key as role_key from dbo.Ft_Split(@power,',')
) A left join y_role_power B on  A.power_key=B.power_key and A.role_key=B.role_key
where b.role_key is null
 